<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>
<html>
<head>
<title>设置cookie</title>
</head>
<body>
<div onclick="getCookie()">点击我显示cookie</div>
<div id="cooki">
</div>
<script type="text/javascript">
function getCookie(){
	var cookieStr=document.cookie;
	document.getElementById("cooki").innerHTML=cookieStr;
}
</script>
</body>
</html>